package com.ims.core.saleconfig.service.impl;

import java.util.List;
import com.ims.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ims.core.saleconfig.mapper.TSalTaxCategoryMapper;
import com.ims.core.saleconfig.domain.TSalTaxCategory;
import com.ims.core.saleconfig.service.ITSalTaxCategoryService;

/**
 * 税收分类Service业务层处理
 *
 * @author IMS
 * @date 2024-05-20
 */
@Service
public class TSalTaxCategoryServiceImpl implements ITSalTaxCategoryService
{
    @Autowired
    private TSalTaxCategoryMapper tSalTaxCategoryMapper;

    /**
     * 查询税收分类
     *
     * @param id 税收分类主键
     * @return 税收分类
     */
    @Override
    public TSalTaxCategory selectTSalTaxCategoryById(Long id)
    {
        return tSalTaxCategoryMapper.selectTSalTaxCategoryById(id);
    }

    /**
     * 查询税收分类列表
     *
     * @param tSalTaxCategory 税收分类
     * @return 税收分类
     */
    @Override
    public List<TSalTaxCategory> selectTSalTaxCategoryList(TSalTaxCategory tSalTaxCategory)
    {
        return tSalTaxCategoryMapper.selectTSalTaxCategoryList(tSalTaxCategory);
    }

    /**
     * 新增税收分类
     *
     * @param tSalTaxCategory 税收分类
     * @return 结果
     */
    @Override
    public int insertTSalTaxCategory(TSalTaxCategory tSalTaxCategory)
    {
        tSalTaxCategory.setCreateTime(DateUtils.getNowDate());
        return tSalTaxCategoryMapper.insertTSalTaxCategory(tSalTaxCategory);
    }

    /**
     * 修改税收分类
     *
     * @param tSalTaxCategory 税收分类
     * @return 结果
     */
    @Override
    public int updateTSalTaxCategory(TSalTaxCategory tSalTaxCategory)
    {
        tSalTaxCategory.setUpdateTime(DateUtils.getNowDate());
        return tSalTaxCategoryMapper.updateTSalTaxCategory(tSalTaxCategory);
    }

    /**
     * 批量删除税收分类
     *
     * @param ids 需要删除的税收分类主键
     * @return 结果
     */
    @Override
    public int deleteTSalTaxCategoryByIds(Long[] ids)
    {
        return tSalTaxCategoryMapper.deleteTSalTaxCategoryByIds(ids);
    }

    /**
     * 删除税收分类信息
     *
     * @param id 税收分类主键
     * @return 结果
     */
    @Override
    public int deleteTSalTaxCategoryById(Long id)
    {
        return tSalTaxCategoryMapper.deleteTSalTaxCategoryById(id);
    }
}
